Conversation
feat: add guide on how to become a market maker
WalkthroughThis pull request adds documentation for running a market-maker solver on the NEAR Intents Message Bus. It introduces a new MDX guide file and updates the documentation navigation structure with a new Guides group under Market Makers. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs.json (1)
105-110: Consider adding an icon for visual consistency.The "Message Bus" and "Token Bridges" sibling groups have icons, while "Guides" and "Services" do not. Adding an icon (e.g.,
"icon": "book"or"icon": "graduation-cap") would improve visual consistency across the navigation.📝 Suggested change
{ "group": "Guides", + "icon": "graduation-cap", "pages": [ "integration/market-makers/become-market-maker-guide" ] },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs.json` around lines 105 - 110, Update the "Guides" navigation entry to include an icon property for visual consistency with sibling groups; specifically add an "icon" field (e.g., "icon": "book" or "icon": "graduation-cap") to the object that contains "group": "Guides" and "pages": ["integration/market-makers/become-market-maker-guide"] so the entry mirrors how "Message Bus" and "Token Bridges" define icons.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@integration/market-makers/become-market-maker-guide.mdx`:
- Around line 87-93: The docs currently instruct hardcoding the API key into
src/services/websocket-connection.service.ts (and reference a fragile line
number); instead instruct users to add RELAY_API_KEY=your_api_key_here to their
.env.local and update the guide text to remove the line-numbered edit. Change
the guide to say the WebSocket connection service
(websocket-connection.service.ts) will read process.env.RELAY_API_KEY and
include it as the Bearer token in the Authorization header, and update the
snippet to show adding the RELAY_API_KEY to .env.local (do not show hardcoded
keys in source).
---
Nitpick comments:
In `@docs.json`:
- Around line 105-110: Update the "Guides" navigation entry to include an icon
property for visual consistency with sibling groups; specifically add an "icon"
field (e.g., "icon": "book" or "icon": "graduation-cap") to the object that
contains "group": "Guides" and "pages":
["integration/market-makers/become-market-maker-guide"] so the entry mirrors how
"Message Bus" and "Token Bridges" define icons.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fe92f811-eaf2-48cb-a662-cdc798710dd6
📒 Files selected for processing (2)
docs.jsonintegration/market-makers/become-market-maker-guide.mdx
| Once issued, open `src/services/websocket-connection.service.ts` and add your API key as a Bearer token in the WebSocket connection headers at line 35: | ||
|
|
||
| ```typescript | ||
| headers: { | ||
| Authorization: `Bearer ${YOUR_API_KEY}`, | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, check if the MDX file exists and read the relevant section
fd "become-market-maker-guide.mdx" --type fRepository: defuse-protocol/docs
Length of output: 119
🏁 Script executed:
# Get the content around lines 87-93 of the MDX file
if [ -f "integration/market-makers/become-market-maker-guide.mdx" ]; then
sed -n '80,100p' "integration/market-makers/become-market-maker-guide.mdx"
fiRepository: defuse-protocol/docs
Length of output: 762
🏁 Script executed:
# Check for TypeScript files that handle API keys or environment variables
rg -n "RELAY_API_KEY|Authorization.*Bearer|headers.*Authorization" --type ts -A 2 -B 2 | head -50Repository: defuse-protocol/docs
Length of output: 212
🏁 Script executed:
# Look for .env files and configuration examples
fd -e "\.env*" -o -name "*.example" | head -20Repository: defuse-protocol/docs
Length of output: 294
🏁 Script executed:
# Check websocket-connection.service.ts specifically
fd "websocket-connection.service.ts" --type fRepository: defuse-protocol/docs
Length of output: 46
🏁 Script executed:
# Check what type of repository this is
ls -la | head -20Repository: defuse-protocol/docs
Length of output: 1165
🏁 Script executed:
# Look for any SDK files or example projects
find . -name "package.json" -o -name "tsconfig.json" -o -name ".env*" | head -20Repository: defuse-protocol/docs
Length of output: 46
🏁 Script executed:
# Search for references to websocket or API key configuration in the docs
rg "websocket|api.key|env.local" -i --type mdx | head -30Repository: defuse-protocol/docs
Length of output: 91
🏁 Script executed:
# Check for any example code or implementation guides
fd -e "mdx" -type f -exec rg -l "websocket-connection\|Bearer.*token\|Authorization" {} \;Repository: defuse-protocol/docs
Length of output: 234
🏁 Script executed:
# Search for websocket references in all files
rg "websocket|Bearer.*API" -i | head -40Repository: defuse-protocol/docs
Length of output: 3491
🏁 Script executed:
# Check the integration directory structure
find integration -type f -name "*.mdx" | head -20Repository: defuse-protocol/docs
Length of output: 1136
🏁 Script executed:
# Search for any links to SDK or implementation code
rg "github\.com|src/services|\.env" | head -30Repository: defuse-protocol/docs
Length of output: 6837
🏁 Script executed:
# Check if there are references to other documentation files about setup
rg "setup|install|initialize|configure" -i integration/market-makers/ | head -20Repository: defuse-protocol/docs
Length of output: 2169
Avoid hardcoding the API key in source files; use environment variables instead.
The documentation contradicts itself. It earlier instructs users to configure env/.env.local and warns against committing API keys to version control, but then instructs them to hardcode the API key directly in src/services/websocket-connection.service.ts at line 35. Additionally, referencing a specific line number is fragile and breaks when code changes.
Instead, add the API key to the .env.local file that users are already instructed to create:
-Once issued, open `src/services/websocket-connection.service.ts` and add your API key as a Bearer token in the WebSocket connection headers at line 35:
+Once issued, add your API key to `env/.env.local`:
-```typescript
-headers: {
- Authorization: `Bearer ${YOUR_API_KEY}`,
-}
+```bash
+RELAY_API_KEY=your_api_key_here+The WebSocket connection service will automatically read this value and include it in the Bearer token.
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @integration/market-makers/become-market-maker-guide.mdx around lines 87 -
93, The docs currently instruct hardcoding the API key into
src/services/websocket-connection.service.ts (and reference a fragile line
number); instead instruct users to add RELAY_API_KEY=your_api_key_here to their
.env.local and update the guide text to remove the line-numbered edit. Change
the guide to say the WebSocket connection service
(websocket-connection.service.ts) will read process.env.RELAY_API_KEY and
include it as the Bearer token in the Authorization header, and update the
snippet to show adding the RELAY_API_KEY to .env.local (do not show hardcoded
keys in source).
</details>
<!-- fingerprinting:phantom:poseidon:ocelot -->
<!-- This is an auto-generated comment by CodeRabbit -->
This PR adds a Guide on how to become a market maker